﻿using mediaPrime.Sdk;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace mediaPrime.Core.UserControls
{
    /// <summary>
    /// Interaktionslogik für HomeUserControl.xaml
    /// </summary>
    public partial class HomeUserControl : UserControl
    {
        private MainWindow mainWindow;
        public HomeUserControl(MainWindow mainWindow)
        {
            InitializeComponent();

            this.mainWindow = mainWindow;

            // This is only for testing:
            var plugin = mainWindow.PluginManager.LoadPluginById("mediaPrime.Plugin.TV");
            if (plugin != null)
            {
                btnTile1.Content = plugin.GetTileContent();
            }

            plugin = mainWindow.PluginManager.LoadPluginById("mediaPrime.Plugin.System");
            if (plugin != null)
            {
                btnTile2.Content = plugin.GetTileContent();
            }

            this.Loaded += HomeUserControl_Loaded;
        }

        void HomeUserControl_Loaded(object sender, RoutedEventArgs e)
        {

        }

        // This is only for testing:
        private void btnTile2_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.ShowPlugin("mediaPrime.Plugin.System");
        }

        private void btnTile1_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.ShowPlugin("mediaPrime.Plugin.TV");
        }

    }
}
